package task3;

import java.io.*;

public class test3_1 {
    public static void main(String[] args) throws Exception {
       // OutputStream out=new FileOutputStream("a.txt");
        //BufferedOutputStream bos=new BufferedOutputStream(out);
        BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream("a.txt"));
        String s="Hello Java";
        bos.write(s.getBytes());
        bos.close();

        BufferedInputStream bis=new BufferedInputStream(new FileInputStream("a.txt"));
        byte[] bys=new byte[1024];
        int len=0;
        while ((len=bis.read(bys))!=-1){
            System.out.println(new String(bys,0,len));
        }

    }
}
